/*
 * Copyright (c) 2024 Allwinner Device Co., Ltd.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef T507_AIAO_IMPL_H
#define T507_AIAO_IMPL_H

#include <linux/types.h>
#include "audio_platform_base.h"

/* AIO  base address */
#define AIAO_REG_BASE            0x05096000
#define AIAO_MAX_REG_SIZE        0x031C

/* DMA */
#define AHUB_APBIF_0    0
#define AHUB_APBIF_1    1
#define AHUB_APBIF_2    2
#define AHUB_I2S_0      0
#define AHUB_I2S_1      1
#define AHUB_I2S_2      2
#define AHUB_I2S_3      3
#define AHUB_APBIF_USE  AHUB_APBIF_0
#define AHUB_I2S_USE    AHUB_I2S_0

#define DMATX_DTSTREEPATH           "/soc@3000000/codec@5096000"
#define DMARX_DTSTREEPATH           "/soc@3000000/ahub@5097000"
#define SUNXI_SNDTX_ADDR_BASE       0x05096000
#define SUNXI_SNDRX_ADDR_BASE       0x05097000
#define SUNXI_SNDTX_DATA            0x20
#define SUNXI_AHUB_APBIF_RXFIFO(n)  (0x120 + ((n) * 0x30))

#define SUNXI_DMA_DST_ADDR          SUNXI_SNDTX_ADDR_BASE + SUNXI_SNDTX_DATA
#define SUNXI_DMA_SRC_ADDR          SUNXI_SNDRX_ADDR_BASE + SUNXI_AHUB_APBIF_RXFIFO(AHUB_APBIF_USE)

#endif // T507_AIAO_IMPL_H